package org.obm.delivery.cassandra.impl;

import org.obm.cassandra.client.CassHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Writes a splitted up message into cassandra.
 * 
 * @author tom
 * 
 */
public class CassWriter {

	private Logger logger = LoggerFactory.getLogger(getClass());

	public void write(BlownUpMessage bum) {
		WriteBUMCommand wbc = new WriteBUMCommand(bum);
		boolean success = CassHelper.run("bigg", wbc);
		if (success) {
			logger.info("Message written successfully to cassandra");
		} else {
			logger.error("Message was not delivered to cassandra");
		}
	}

}
